<!--
 * @Date: 2021-11-25 11:11:37
 * @LastEditors: xiaolan
 * @LastEditTime: 2021-11-25 13:17:18
 * @FilePath: \pms\web\notice\staticPublish.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>通知信息统计</title>

	<link rel="stylesheet" href="../assets/font-awesome/4.5.0/css/font-awesome.min.css" />
	<link rel="stylesheet" href="../assets/css/jquery-ui.min.css" />
	<link rel="stylesheet" href="../assets/css/components.css">
	<link rel="stylesheet" href="../assets/css/bootstrap.min.css">
	<link rel="stylesheet" href="../assets/css/uniform.default.css">
	<link rel="stylesheet" href="../assets/css/bootstrap-switch.min.css">
	<link rel="stylesheet" href="../assets/css/layout.css">
	<link rel="stylesheet" href="../assets/css/plugins.css">
	<link rel="stylesheet" href="../assets/css/darkblue.css">
	<link rel="stylesheet" href="../assets/css/custom.css">
</head>

<body>
	<div>
		<div class="col-md-12">
			<!-- BEGIN CHART PORTLET-->
			<div class="portlet light bordered">
				<div class="portlet-title">
					<div class="caption">
						<i class="icon-bar-chart font-green-haze"></i>
						<span class="caption-subject bold uppercase font-green-haze"> Bar Charts</span>
						<span class="caption-helper">column and line mix</span>
					</div>
				</div>
				<div class="portlet-body">
					<div id="chart" style="height: 800px;">
					</div>
				</div>
			</div>
			<!-- END CHART PORTLET-->
		</div>
	</div>


	<script src="../assets/js/jquery-2.1.4.min.js"></script>
	<script src="../assets/js/jquery-migrate.min.js"></script>
	<script src="../assets/js/jquery-ui.min.js"></script>
	<script src="../assets/js/bootstrap.min.js"></script>
	<script src="../assets/js/jquery.slimscroll.min.js"></script>
	<script src="../assets/js/bootstrap-datepicker.min.js"></script>
	<script src="../assets/js/ace-elements.min.js"></script>
	<script src="../assets/js/ace.min.js"></script>
	<script src="../assets/js/jquery.uniform.min.js"></script>

	<script src="../assets/js/echarts.min.js"></script>

	<script>
		let noticeObj = JSON.parse(sessionStorage.getItem('noticeObj'))
		let list = noticeObj.noticeList;
		let map = new Map()
		for (let item of list) {
			map.set(item.publisherName, (map.get(item.publisherName) || 0) + 1)
		}
		let peopleList = []
		let noticeNum = []
		for (let item of map) {
			for (let i in item) {
				if (i % 2 == 0) {
					peopleList.push(item[i])
				} else {
					noticeNum.push(item[i])
				}
			}
		}
		var chartDom = document.getElementById('chart')
		var myChart = echarts.init(chartDom)
		var options = {
			title: {
				text: '小组通知条数列表',
				left: 'center',
				top: 'top',
				textStyle: {
					fontSize: 32,
					color: "rgba(141, 99, 214, 0.72)"
				},
			},
			color: ["#3398DB", "#2C7659"],
			xAxis: {
				name: '小组成员',
				type: 'category',
				data: peopleList,
				nameTextStyle: {
					fontSize: 24
				}
			},
			yAxis: {
				name: "通知条数",
				type: 'value',
				nameTextStyle: {
					fontSize: 24
				},
				max:10
			},
			series: [{
				name: "通知条数",
				data: noticeNum,
				type: 'bar'
			}]
		}
		options && myChart.setOption(options)
	</script>
</body>

</html>